#include <iostream>
#include <string>
#include "gravity.h"

class Test : public Solid{
	std::string name;
	
	public:
		Test(const std::string& name,Rectangle rec,bool floor=false)
			: Solid(rec,floor){
			this->name = name;
		}
		~Test(){}

		void notifyCollision(Solid* solid){
			std::cout << this->name << " ha colisionado con " << static_cast<Test*>(solid)->name << std::endl;
		}

		void printRectangle(){
			std::cout << "Dimensiones de " << name << std::endl;
			std::cout << "x1= " << getSize().x1 << "| x2= " << getSize().x2 << "| y1= " << getSize().y1 << "| y2=" << getSize().y2 << std::endl; 
		}
};

int main(){
	Gravity g(5.0f);
	Test t1("a",Rectangle(0.0f,100.0f,60.0,70.0f),true);
	Test t2("b",Rectangle(0.0f,10.0f,30.0f,40.0f));
	Test t3("c",Rectangle(10.0f,20.0f,10.0f,20.0f));
	Test t4("d",Rectangle(10.0f,30.0f,30.4f,40.0f));
	g.addSolid(&t1);
	//g.addSolid(&t2);
	g.addSolid(&t3);
	g.addSolid(&t4);
	for(unsigned int c=0;c!=4;c++){
		g.advanceTime();
		//t2.printRectangle();
		t4.printRectangle();
		t3.printRectangle();
	}
}
